<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="a" uri="/WEB-INF/app.tld"%>
<a:body>
    <jsp:attribute name="csstype">dashboard</jsp:attribute>
</a:body>
<style>
	iframe {
		width:100%;
		margin:0 0 1em;
		border:0;
	}
</style>
<div class="bodywrapper">
    <div class="centercontent">
        <iframe src="https://www.baidu.com" marginheight="0" marginwidth="0" id="ciframe" scrolling="no" frameborder="0" style="width:100%;">

        </iframe>
    </div>
</div>
<script type="text/javascript" language="javascript">
//marginheight="0" marginwidth="0" 
// onload="iFrameHeight()"
	var p="${p}";
    var url = getRealUrl(p);
    if (url != null) {
        jQuery('#ciframe').attr("src", url + "?" + window.location.search.substr(1));
    }
    //jQuery("#ciframe").load(function () {
        //var mainheight = jQuery(this).contents().find("body").height() + 30;
        //jQuery(this).height(mainheight);
    	//changeFrameHeight();
    //});
    function autoHeight() {
    var ifr = document.getElementById('ciframe');
    ifr.height = (ifr.contentDocument && ifr.contentDocument.body.offsetHeight)
            || (ifr.contentWindow.document.body.scrollHeight);
	}
    function changeFrameHeight(){
        /* var ifm= document.getElementById("ciframe"); 
        ifm.height=document.documentElement.clientHeight; */
    }
    function iFrameHeight() {
        var ifm= document.getElementById("ciframe");
        var subWeb = document.frames ? document.frames["ciframe"].document :
			ifm.contentDocument;
            if(ifm != null && subWeb != null) {
            ifm.height = subWeb.body.scrollHeight;
            }
    }
/*      window.onresize=function(){  
    	iFrameHeight();  
    } */
    /* function setIframeHeight(iframe) {
    	if (iframe) {
	    	var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
	    	if (iframeWin.document.body) {
	    		iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
	    	}
    	}
    }; */

   	/* window.onload = function () {
   		setIframeHeight(document.getElementById('ciframe'));
   	}; */
   	/* jQuery("#ciframe").load(function () {
   	    var mainheight = jQuery(this).contents().find("body").height() + 30;
   	 jQuery(this).height(mainheight);
   	}); */
</script>
